<template>
  <div>
    <p>{{ base64 }}</p>
    <img :src="base64" alt="" />
  </div>
</template>
<script>
import base64ToFile from '@/utils/base64ToFile'
export default {
  data () {
    return {
      base64:
        ''
    }
  },
  mounted () {
    this.base64ToFile()
  },
  methods: {
    base64ToFile () {
      const file = base64ToFile(this.base64, 'test')
      // 转成文件后可以提交到后台
      console.log(file)
    }
  }
}
</script>
